﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.SqlClient;
using System.IO;

//0712455
namespace DAO
{
    public class KetNoiCSDL
    {
        private static string DataSource()
        {
            try
            {
                using (StreamReader reader = new StreamReader("../../Setting.dat"))
                {
                    string strDataSource = reader.ReadLine().Trim();
                    return strDataSource;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

        public static SqlConnection TaoKetNoi()
        {
            string cnnString = String.Format("Data Source={0};Initial Catalog=NganHang;Integrated Security=True", DataSource());
            return new SqlConnection(cnnString);
        }
    }
}
